import {createBrowserRouter} from 'react-router-dom'
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
    TeamOutlined,
    UserOutlined,
} from '@ant-design/icons';

import App from '../App'
import Home from '../pages/home/Index'
import Error from '../pages/error/Index'

import { lazy } from 'react'
const Index=lazy(()=>import ('../pages/index/Index'))
const Ment=lazy(()=>import ('../pages/ment/Index'))

const One=lazy(()=>import ('../pages/ment/one/Index'))

export const children=[
    {
        path:'/home/index',
        element:<Index></Index>,
        title:'11111',
        icon:<DesktopOutlined></DesktopOutlined>
    },
    {
        path:'/home/ment',
        element:<Ment></Ment>,
        title:'222',
        icon:<FileOutlined></FileOutlined>,
        children:[
            {
                path:'/home/ment/one',
                element:<One></One>,
                title:'3333',
                icon:<PieChartOutlined></PieChartOutlined>
            }
        ]
    },
]

const router=[
    {
        path:'/',
        element:<App></App>,
        children:[
            {
                index:true,
                element:<Home></Home>,
            },
            {
                path:'/home',
                element:<Home></Home>,
                children:children
            }
        ]
    },
    {
        path:'*',
        element:<Error></Error>
    }
]
export default createBrowserRouter(router);